import React, { Component } from 'react';
import {
  StyleSheet, Text, View, TouchableOpacity,
  PixelRatio, Image, FlatList, ScrollView
} from "react-native";
import { NavigationEvents } from 'react-navigation';
import { GLOBAL } from '../../../config/global';
import { style } from '../../../theme/style';
import { Common } from '../../../component/common/Common.js';
import StorageHelper from '../../../utils/storageHelper';
import { STORAGE_CONSTANT } from '../../../config/storage';
import { PageStatusIndex } from '../../../component/page-status/PageStatusIndex';
import { RefuseModal } from '../../../component/ModalVerifylComponent.js';
import { ProgressModal } from '../../../components/common/ProgressModal';
import { CommonDialog } from '../../../components/common/Dialog';
import OrderDetailsService from '../../../containers/order-new/details/_common/service';
import ModalPicDelComponent from '../../../component/ModalPicDelComponent';
import HTTP from '../../../utils/http'
import { API, API_GENERATE } from '../../../config/api';
import Echarts from 'native-echarts';
import moment from 'moment';
import { CURRENCY } from '../../../utils/helper';
import ToastUtil from '../../../utils/toast';
import { StateSectionNew } from '../../order/approve/details/_component/StateSectionNew';
const arrowIcon = require('../../../imgs/sanjiao3.png');

const scale = GLOBAL.SCALE;


export class inventoryApprovalDetail extends Component {
  static navigationOptions = ({ navigation, navigationOptions }) => {
    return {
      header:null
      // headerTitle: '盘点申请审批',
      // headerTintColor: style.color.white,
      // headerLeft: <Common type="headLeft" onPress={() => { navigation.goBack() }} color='#fff' />,
      // headerRight: (<Image style={style.head.headRightEmpty} source={require('../../../imgs/goBackEmpty.png')} />),
      // headerStyle: {  // 头部整体样式 
      //   elevation: 0,
      //   borderBottomWidth: 0,
      //   backgroundColor: style.color.themeColor
      // },
      // headerTitleStyle: {
      //   flex: 1,
      //   textAlign: 'center'
      // }
    }
  };
  constructor(props) {
    super(props);
    this.params = this.props.navigation.state.params;
    console.log(this.params, '99')
    let {reportId,taskId,checkType,processInstanceId,corpId,status} = this.params || {};
    this.state = {
      tabIndex: 0,
      modalVisibles: false,
      refreshIcon: false,
      status: 'data',
      listData: [],
      resData:{
        stockCheckReportVO:{},
        sheetFileList:[],
        bizFileAuditList:[],
        stockCheckReportDetailList:[]
      },
      options: [],
      choiceArr: [
      ],
      listDatass: [{
      }],
      lightBoxData: {
        modalVisible: false,
        onClosePress: this._closeLightBox,
        title: '',
        rowDataList: [],
        status: 'data',
        refreshIcon: false,
      },
    }
    this.reportId = reportId
    this.status = status
    this.taskId = taskId
    this.checkType = checkType
    this.processInstanceId = processInstanceId
    this.corpId = corpId
    this.pageNo = 1;
    this.totalPage = 1;
    this.reload = true;
    this.pageParams = { // TODO
      reportId,
      taskId,
      checkType
    };
    this.TAB = []
  }
  async componentWillMount () {
    await this._initPage();
  }

  // 初始化数据
  _initPage = async () => {
    this.setState({
      status: this.reload ? 'loading' : 'data',
      refreshIcon: !this.reload,
    })
    let res = await HTTP.POST(API_GENERATE(API.CHECK_AUDIT_DETAIL), this.pageParams)  
    if(this.checkType == 1||this.checkType == 2){
      this.TAB = [
        {
          name: '盘点信息及附件',
          id: 0, 
        }, {
          name: '盘点报告商品',
          id: 1, 
        }, {
          name: '盈亏处理明细',
          id: 2, 
        }
      ]
    }
    else if(this.checkType == 3){
      this.TAB = [
        {
          name: '申报信息及附件',
          id: 0, 
        }, {
          name: '损溢申报商品批明细',
          id: 1, 
        }
      ]
    }
    if (res) {
      this.setState({
        status: res ? 'data' : 'empty',
        resData: res,
        listDatas: res.applyItemList,
        refreshIcon: false
      })
    } else {
      this.setState({
        refreshIcon: false,
        status: 'error'
      })
    }
  }


  //切换
  _tabFn = (tabIndex) => {
    // this.reload = true;
    this.pageParams.pageNo = 1;
    this.setState({
      tabIndex,
    })
  }
  // 刷新页面
  _onErrorRefresh = () => {
    this.pageParams.pageNo = 1;
    this.reload = true;
    this._initPage();
  }

  // 审批
  approve = async () => {
    const { listData, tabIndex } = this.state;
    // if (this.requesting) return;
    this.setState({ showRejectModal: false, });
    // this.requesting = true;
    let requestParams = {
      checkType: this.checkType,
      reportId: this.reportId,
      taskId: this.taskId,
      status:this.status,
      auditResult: this.auditResult,
      auditRemark: this.remark,
    };
    let text = this.auditResult ? '同意' : '驳回';
    this.setState({ status: 'loading' });
    let res = await HTTP.POST(API_GENERATE(API.CHECK_AUDIT_STOCK), requestParams);
    // this.requesting = false;
    if (res) {
      ToastUtil.showSuccess(`${text}成功`).then(() => {
        this.props.navigation.state.params.callback();
        this.props.navigation.goBack()
      })
    } else {
      this.setState({
        status: 'data'
      })
    }
  }
  // 审批流
  _getCheckApprove = async () => {
    let { listData } = this.state;
    this.setState({ status: 'loading' })
    //查询审批节点
    let responseData1 
    if(this.checkType!=2){
			responseData1 = await  HTTP.POST(API_GENERATE(API.CHECK_AUDIT_LOG),{
				checkType:this.checkType,
				reportId:this.reportId,
				bizObjType:'WMS_CHECK',
				processInstanceId:this.processInstanceId,
				corpId:this.params.corpId,
			});
		}
		if(this.checkType==2){
			responseData1 = await  HTTP.POST(API_GENERATE(API.CHECK_AUDIT_LOG),{
				checkType:this.checkType,
        reportId:this.reportId,
			});
		}
    // console.log(responseData1, '99888888')
    responseData1 = responseData1 && responseData1.map((item) => {
      if (item.auditResult == 9) {
        item.auditResultName = '操作';
      }
      return item;
    })
    let { lightBoxData } = this.state;
    lightBoxData.modalVisible = true;
    lightBoxData.title = '审批状态';
    lightBoxData.rowDataList = responseData1;
    this.setState({
      lightBoxData,
      status: 'data'
    })
  }

  _closeLightBox = () => {
    let { lightBoxData } = this.state;
    lightBoxData.modalVisible = false;
    this.setState({ lightBoxData });
  }

  _renderApprove = (item) => {
    let { listData } = this.state
    return (
        <View style={styles.flexWhole}>
          {/* <View style={styles.flexWholeName}>
            <Text style={styles.flexWholeTitle} onPress={() => { this._getCheckApprove() }}>审批流</Text>
          </View> */}
          <View style={styles.itemDayTime}>
            <Text style={[styles.consent,]} onPress={() => {
              this.auditResult = 1;
              this.remark = '';
              this.setState({
                showRejectModal: true,
                listData,
              })
              // this.consentCreate(item)
            }}>同意</Text>
            <Text style={styles.itemdown} onPress={() => {
              if (listData) {
                this.auditResult = 0;
                this.remark = '';
                this.setState({
                  showRejectModal: true,
                  listData
                })
              } else {
                ToastUtil.showWarning('没有数据')
              }
            }}>驳回</Text>
          </View>
        </View>
    )
  }

  listOne = () =>{
    let { resData } = this.state;
    let {stockCheckReportVO,sheetFileList,bizFileAuditList} = resData
    return (
      <View style={{marginTop:25*scale,paddingHorizontal:20*scale}}>
        <View style={styles.dataItem}>
          <Text style={styles.dataItemTitle}>{this.checkType==1?'创建人':'盘点创建人'}</Text>
          <Text style={styles.dataItemText}>{stockCheckReportVO.createName}</Text>
        </View>
        {this.checkType==2?
          <View>
            <View style={styles.dataItem}>
            <Text style={styles.dataItemTitle}>盘点提交人</Text>
            <Text style={styles.dataItemText}>{stockCheckReportVO.applyPersonName||'-'}</Text>
          </View>
          <View style={styles.dataItem}>
            <Text style={styles.dataItemTitle}>创建日期</Text>
            <Text style={styles.dataItemText}>{stockCheckReportVO.createTime}</Text>
          </View>
        </View>:null
        }
        <View style={styles.dataItemH}>
          <Text style={[styles.dataItemTitle,{marginBottom:5*scale}]}>{this.checkType==1?'备注':'盘点总结'}</Text>
          <Text style={styles.dataItemText}>{stockCheckReportVO.remark}</Text>
        </View>
          {sheetFileList&&sheetFileList.length>0?
            <View style={styles.dataBottomItem}>
              <Text style={styles.dataBottomTitle}>盘点附件</Text>
              <View style={styles.fileItem}>
                {sheetFileList.map((item,index)=>{
                  return(
                    <TouchableOpacity key={index}  onPress={() => { this.props.navigation.navigate('ContractPdfPage', { finalFileId: item.fileId, title: item.fileName}) }}>
                      <Text style={styles.fileText}>
                        【{item.fileName}】
                      </Text>
                    </TouchableOpacity>
                  )
                })}
              </View>
            </View>
            :null
          }
        {bizFileAuditList&&bizFileAuditList.length>0?
          <View style={styles.dataBottomItem}>
          <Text style={styles.dataBottomTitle}>盘点报告复核附件</Text>
          <View style={styles.fileItem}>
            {bizFileAuditList.map((item,index)=>{
              return(
                <TouchableOpacity key={index}  onPress={() => { this.props.navigation.navigate('ContractPdfPage', { finalFileId: item.fileId, title: item.fileName}) }}>
                  <Text style={styles.fileText}>
                    【{item.fileName}】
                  </Text>
                </TouchableOpacity>
              )
            })}
          </View>
        </View>:null
        }
        
      </View>
    )
  }
  listTwo = () =>{
    let { resData } = this.state;
    let {stockCheckReportDetailList} = resData
    return (
      <View style={{marginTop:25*scale,paddingHorizontal:20*scale}}>
          {stockCheckReportDetailList&&stockCheckReportDetailList.length>0?
            <View>
                {stockCheckReportDetailList.map((item,index)=>{
                  return(
                    <View style={styles.dataShopItem} key={index}>
                      <Text style={styles.dataShopTitle}>{item.goodsName}</Text>
                      <View style={styles.dataShopContent}>
                        <View style={styles.dataShopHorizontal}>
                          <Text style={styles.dataShopText}>包装规模</Text>
                          <Text style={styles.dataShopText}>{item.packagingSpec||'-'}</Text>
                        </View>
                        <View style={styles.dataShopHorizontal}>
                          <Text style={styles.dataShopText}>单位</Text>
                          <Text style={styles.dataShopText}>{item.uomName||'-'}</Text>
                        </View>
                        <View style={styles.dataShopHorizontal}>
                          <Text style={styles.dataShopText}>库存数量</Text>
                          <Text style={styles.dataShopText}>{item.stockQuantity||item.stockQuantity==0?item.stockQuantity:'-'}</Text>
                        </View>
                      </View>
                      <View style={styles.dataShopContent}>
                        <View style={styles.dataShopHorizontal}>
                          <Text style={styles.dataShopText}>补录数量</Text>
                          <Text style={styles.dataShopText}>{item.replenishQuantity||item.replenishQuantity==0?item.replenishQuantity:'-'}</Text>
                        </View>
                        <View style={styles.dataShopHorizontal}>
                          <Text style={styles.dataShopText}>盘点数量</Text>
                          <Text style={styles.dataShopText}>{item.checkQuantity||item.checkQuantity==0?item.checkQuantity:'-'}</Text>
                        </View>
                        <View style={styles.dataShopHorizontal}>
                          <Text style={styles.dataShopText}>盈亏数量</Text>
                          <Text style={styles.dataShopText}>{item.difference||item.difference==0?item.difference:'-'}</Text>
                        </View>
                      </View>
                      <View style={styles.dataShopContent}>
                        <View style={styles.dataShopHorizontal}>
                          <Text style={styles.dataShopText}>盈亏单价</Text>
                          <Text style={styles.dataShopText}>{item.differencePrice||item.differencePrice==0?'¥'+item.differencePrice+'/'+item.uomName:'-'}</Text>
                        </View>
                        <TouchableOpacity style={{flex:2}}>
                          <Text style={styles.dataShopText}>附件</Text>
                            {item.fileId?
                              <TouchableOpacity key={index} onPress={() => { this.props.navigation.navigate('ContractPdfPage', { finalFileId: item.fileId, title: item.fileName}) }}>
                                <Text style={styles.fileText}>【附件】</Text>
                              </TouchableOpacity>
                                :<Text style={styles.dataShopText}>-</Text>
                            }
                        </TouchableOpacity>
                      </View>
                    </View>
                  )
                })}
            </View>
            :null
          }
        
      </View>
    )
  }
  listThree = () =>{
    let { resData } = this.state;
    let {stockCheckInoutWarehouseList} = resData
    return (
      <View style={{marginTop:25*scale,paddingHorizontal:20*scale}}>
          {stockCheckInoutWarehouseList&&stockCheckInoutWarehouseList.length>0?
            <View>
                {stockCheckInoutWarehouseList.map((item,index)=>{
                  return(
                    <View key={index}>
                      <Text style={styles.dataShopDetail}>订单号 {item.orderId}</Text>
                      <View style={styles.dataShopItem}>
                        <Text style={styles.dataShopTitle}>{item.goodsName}</Text>
                        <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>采购批次号</Text>
                            <Text style={styles.dataShopText}>{item.procurementBatchNo||'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>入库批次号</Text>
                            <Text style={styles.dataShopText}>{item.inStockBatchNo||'-'}</Text>
                          </View>
                        </View>
                        <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>组织机构</Text>
                            <Text style={styles.dataShopText}>{item.corpName||'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>产品组</Text>
                            <Text style={styles.dataShopText}>{item.bizTeamName||'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>业务线领导</Text>
                            <Text style={styles.dataShopText}>{item.auditLeaderName||'-'}</Text>
                          </View>
                        </View>
                        {this.checkType==1?
                        <View>
                          <View style={styles.dataShopContent}>
                            <View style={styles.dataShopHorizontal}>
                              <Text style={styles.dataShopText}>部门</Text>
                              <Text style={styles.dataShopText}>{item.organName||'-'}</Text>
                            </View>
                            <View style={styles.dataShopHorizontal}>
                              <Text style={styles.dataShopText}>入库日期</Text>
                              <Text style={styles.dataShopText}>{item.inboundTime?item.inboundTime.substring(0,11):'-'}</Text>
                            </View>
                            <View style={styles.dataShopHorizontal}>
                              <Text style={styles.dataShopText}>实物库存</Text>
                              <Text style={styles.dataShopText}>{item.stockQuantity||item.stockQuantity==0?item.stockQuantity:'-'}</Text>
                            </View>
                          </View>
                          <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                              <Text style={styles.dataShopText}>调整类型</Text>
                              <Text style={styles.dataShopText}>{item.inoutFlag&&item.inoutFlag!==0?item.inoutFlag===1?'入库':'出库':'-'}</Text>
                            </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>变动数量</Text>
                            <Text style={styles.dataShopText}>{item.difference||item.difference==0?item.difference+item.uomName:'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                          </View>
                        </View>
                         </View>
                         :null
                        }
                        {this.checkType==2?
                          <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>变动数量</Text>
                            <Text style={styles.dataShopText}>{item.difference||item.difference==0?item.difference+item.uomName:'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                          </View>
                        </View>:null
                        }
                        
                      </View>
                    </View>
                  )
                })}
            </View>
            :null
          }
        
      </View>
    )
  }
  listFour = () =>{
    let { resData } = this.state;
    let {stockCheckReportVO,sheetFileList} = resData
    return (
      <View style={{marginTop:25*scale,paddingHorizontal:20*scale}}>
        <View style={styles.dataItem}>
          <Text style={styles.dataItemTitle}>创建人</Text>
          <Text style={styles.dataItemText}>{stockCheckReportVO.createName}</Text>
        </View>
        <View style={{flexDirection:'column',marginBottom:15*scale}}>
          <Text style={[styles.dataItemTitle,{marginBottom:9*scale}]}>备注</Text>
          <Text style={styles.dataItemText}>{stockCheckReportVO.remark||'-'}</Text>
        </View>
          {sheetFileList&&sheetFileList.length>0?
            <View style={styles.dataBottomItem}>
              <Text style={styles.dataBottomTitle}>库存批次损溢申报附件</Text>
              <View style={styles.fileItem}>
                {sheetFileList.map((item,index)=>{
                  return(
                    <TouchableOpacity key={index} onPress={() => { this.props.navigation.navigate('ContractPdfPage', { finalFileId: item.fileId, title: item.fileName}) }}>
                      <Text style={styles.fileText}>
                        【{item.fileName}】
                      </Text>
                    </TouchableOpacity>
                  )
                })}
              </View>
            </View>
            :null
          }
      </View>
    )
  }
  listFive = () =>{
    let { resData } = this.state;
    let {stockCheckInoutWarehouseList} = resData
    return (
      <View style={{marginTop:25*scale,paddingHorizontal:20*scale}}>
          {stockCheckInoutWarehouseList&&stockCheckInoutWarehouseList.length>0?
            <View>
                {stockCheckInoutWarehouseList.map((item,index)=>{
                  return(
                    <View key={index}>
                      <Text style={styles.dataShopDetail}>订单号 {item.orderId}</Text>
                      <View style={styles.dataShopItem}>
                        <Text style={styles.dataShopTitle}>{item.goodsName}</Text>
                        <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>采购批次号</Text>
                            <Text style={styles.dataShopText}>{item.procurementBatchNo||'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>入库批次号</Text>
                            <Text style={styles.dataShopText}>{item.inStockBatchNo||'-'}</Text>
                          </View>
                        </View>
                        <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>组织机构</Text>
                            <Text style={styles.dataShopText}>{item.organName||'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>产品组</Text>
                            <Text style={styles.dataShopText}>{item.bizTeamName  ||'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>业务线领导</Text>
                            <Text style={styles.dataShopText}>{item.auditLeaderName||'-'}</Text>
                          </View>
                        </View>
                        <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>调整类型</Text>
                            <Text style={styles.dataShopText}>{item.inoutFlag=='1'?'入库':'出库'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>申报调整数量</Text>
                            <Text style={styles.dataShopText}>{item.difference||item.difference==0?item.difference+'/'+item.uomName:'-'}</Text>
                          </View>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>报溢单价</Text>
                            <Text style={styles.dataShopText}>{item.differencePrice||item.differencePrice==0?item.differencePrice+'/'+item.uomName:'-'}</Text>
                          </View>
                        </View>
                        <View style={styles.dataShopContent}>
                          <View style={styles.dataShopHorizontal}>
                            <Text style={styles.dataShopText}>附件</Text>
                            {item.fileId?
                              <TouchableOpacity key={index} onPress={() => { this.props.navigation.navigate('ContractPdfPage', { finalFileId: item.fileId, title: item.fileName}) }}>
                                <Text style={styles.fileText}>【附件】</Text>
                              </TouchableOpacity>
                                :<Text style={styles.dataShopText}>-</Text>
                            }
                          </View>
                        </View>
                      </View>
                    </View>
                  )
                })}
            </View>
            :null
          }
        
      </View>
    )
  }
  render () {
    let { tabIndex, status, showRejectModal, lightBoxData } = this.state
    let {stockCheckReportVO} = this.state.resData
    return (
      <View style={styles.container}>
        
        <View style={styles.headBox}>
					<View style={styles.topBox}>
						<Common type="headLeft" onPress={() => { this.props.navigation.goBack() }} color='#fff' />
						<Text style={styles.topTitle}>盘点申请审批</Text>
            <TouchableOpacity style={styles.flexWholeName} onPress={() => { this._getCheckApprove() }}>
              <Text style={styles.flexWholeTitle}>审批流</Text>
            </TouchableOpacity>
					</View>
				</View>
        <View style={styles.flexBox}>
          <Text style={styles.flexTitle}>主题: {stockCheckReportVO.checkSubject}</Text>
        </View>
        <View style={styles.flexApply}>
          <Text style={styles.flexTitle}>仓库: {stockCheckReportVO.warehouseName}</Text>
        </View>
        <View style={[styles.flexBusiness, styles.flexAccount]}>
      
        {this.checkType==1?
          <Text style={styles.flexBusinessName}>盘点日期：{stockCheckReportVO.createTime?stockCheckReportVO.createTime.substring(0,16):'-'} </Text>
          : 
          <Text style={styles.flexBusinessName}>盘点时间：{stockCheckReportVO.createTime&&stockCheckReportVO.checkEndTime?
            (stockCheckReportVO.createTime.substring(0,16)+'-'+stockCheckReportVO.checkEndTime.substring(0,16)):'-'}</Text>
        }
        </View>
        <View style={styles.headTitleBox}>
          {this.TAB.map((items, index) => {
            return (
              <TouchableOpacity key={index}  onPress={() => { this._tabFn(index) }} style={{flex:1}}>
                <Text style={[styles.tabItems, tabIndex == index ? styles.tabItemActive : null]}>{items.name}
                </Text>
                {tabIndex == index ? (
                  <Text style={{
                    height: 2 * scale, backgroundColor: '#0E7FFD', flexDirection: 'row', paddingLeft: 3 * scale,
                    paddingRight: 3 * scale,marginHorizontal:12*scale
                  }}>
                  </Text>
                ) : null
                }
              </TouchableOpacity>
            )
          })
          }
        </View>
        
        {status == 'data' ?<ScrollView style={{flex:1}}>
          {tabIndex=='0'&&(this.checkType==1||this.checkType==2)?
            this.listOne()
            :null
          }
          {tabIndex=='1'&&(this.checkType==1||this.checkType==2)?
            this.listTwo()
            :null
          }
          {tabIndex=='2'&&(this.checkType==1||this.checkType==2)?
            this.listThree()
            :null
          }
          {tabIndex=='0'&&this.checkType==3?
            this.listFour()
            :null
          }
          {tabIndex=='1'&&this.checkType==3?
            this.listFive()
            :null
          }
        </ScrollView>
        :null}
        {
          status != 'data' ? (<PageStatusIndex status={status} emptyText={'暂无数据'} onErrorPress={this._onErrorRefresh} />) : null
        }        
        {this._renderApprove()}
        {/* 审批流 */}
        <ProgressModal {...lightBoxData} />
        <RefuseModal
          titleText={'审批意见'}
          placeholderText={this.auditResult ? '请输入同意原因' : null}
          propsDefaultValue={this.auditResult ? '审批同意' : '审批驳回'}
          visible={showRejectModal}
          btnPress={(text) => {
            this.remark = text;
            this.approve();
          }}
          bgPress={() => {
            this.setState({
              showRejectModal: false,
            });
          }} />
      </View>
    )

  }
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: style.color.white,
    // paddingBottom: 30 * scale
  },
  flexBusiness: {
    flexDirection: 'row',
    paddingTop: 10 * scale,
    backgroundColor: style.color.themeColor,
    paddingLeft: 28 * scale,
  },
  flexBusinessName: {
    fontSize: 12 * scale,
    color: '#ffffff',
  },
  flexBusinessText: {
    // flexDirection: 'row',
    width: 260 * scale,
    // paddingRight: 20 * scale,
    fontSize: 12 * scale,
    color: '#ffffff',
  },
  flexBox: {
    flexDirection: 'row',
    paddingTop: 10 * scale,
    justifyContent: 'space-between',
    backgroundColor: style.color.themeColor,
    paddingLeft: 28 * scale,
    paddingRight: 35 * scale,
  },
  flexTitle: {
    fontSize: 12 * scale,
    color: '#ffffff',
  },
  flexApply: {
    flexDirection: 'row',
    paddingTop: 10 * scale,
    justifyContent: 'space-between',
    backgroundColor: style.color.themeColor,
    paddingLeft: 28 * scale,
    paddingRight: 60 * scale,
  },
  flexAccount: {
    paddingBottom: 25 * scale,
  },
  headTitleBox: {
    // backgroundColor: style.color.themeColor,
    marginTop: -15 * scale,
    // height: 50 * scale,
    borderTopLeftRadius: 10 * scale,
    borderTopRightRadius: 10 * scale,
    borderWidth: 1 * scale,
    borderStyle: 'solid',
    borderColor: '#fff',
    backgroundColor: '#fff',
    width: '100%',
    flexDirection: 'row',
    justifyContent: 'space-around',
    // paddingLeft: 60 * scale,
    // paddingRight: 60 * scale,
    // height: 600 * scale,
  },
  tabItems: {
    color: '#0E7FFD',
    fontSize: 12 * scale,
    // width: '35%',
    textAlign: 'center',
    marginTop: 20 * scale,
    opacity: .8,
    paddingRight: 5 * scale,
    paddingLeft: 5 * scale,
    paddingBottom: 5 * scale,
  },
  tabItemActive: {
    opacity: 1,
  },
  flexItem: {
    // flexDirection: 'row',
    paddingLeft: 30 * scale,
    paddingRight: 19 * scale,
    paddingTop: 20 * scale,
  },
  flexContent: {
    flexDirection: 'row',
    paddingBottom: 12 * scale,
  },
  flexContentText: {
    flexDirection: 'row',
    paddingBottom: 12 * scale,
  },
  flexItemTexe: {
    flexDirection: 'row',
    width: 120 * scale,
    fontSize: 12 * scale,
    color: '#000000',
    opacity: 0.7,
  },
  flexItemFid: {
    flexDirection: 'row',
    width: 220 * scale,
    flexWrap: 'wrap',
  },
  flexItemVaule: {
    flexDirection: 'row',
    width: 205 * scale,
    fontSize: 12 * scale,
    color: '#000000',
  },
  flexItemExt: {
    paddingRight: 15 * scale,
    fontSize: 12 * scale,
    color: '#000000',
    paddingBottom: 10 * scale,
  },
  flexItemBck: {
    flexDirection: 'row',
    width: 205 * scale,
  },
  flexItemTitle: {
    fontSize: 12 * scale,
    color: '#0091FF',
  },
  flexList: {
    // flexDirection: 'row',
    marginLeft: 10 * scale,
    marginRight: 12 * scale,
    marginTop: 14 * scale,
    borderRadius: 5 * scale,
    borderWidth: 1 * scale,
    borderStyle: 'solid',
    borderColor: style.color.bgGray,
    backgroundColor: style.color.bgGray,
  },
  flexListItem: {
    flexDirection: 'row',
    paddingRight: 5 * scale,
    paddingLeft: 18 * scale,
    paddingTop: 9 * scale,
    paddingBottom: 14 * scale,
  },
  flexListItemName: {
    fontSize: 12 * scale,
    color: '#000000'
  },
  flexMeber: {
    marginLeft: 11 * scale,
    fontSize: 12 * scale,
    color: '#000',
  },
  flexListApply: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    // justifyContent: 'space-around',
    // position: 'relative',
    // marginBottom: 15 * scale,
    paddingLeft: 18 * scale,
    paddingRight: 8 * scale,
  },
  flexListApplyText: {
    flexDirection: 'row',
    width: 107 * scale,
    fontSize: 12 * scale,
    paddingRight: 6 * scale,
    color: '#000',
  },
  flexListApplyMenber: {
    flexDirection: 'row',
    width: 107 * scale,
    paddingRight: 6 * scale,
    fontSize: 12 * scale,
    paddingBottom: 15 * scale,
  },
  flexApplyMenbers: {
    flexDirection: 'row',
    width: 107 * scale,
    fontSize: 12 * scale,
    paddingBottom: 15 * scale,
  },
  flexListApplyVaule: {
    color: '#E02020',
  },
  flexListApplyType: {
    color: '#000',
  },
  flexListApplyNum: {
    color: '#0091FF'
  },
  flexWhole: {
    flexDirection: 'row',
    alignItems: 'center',
    paddingVertical:24*scale,
    backgroundColor:'#F4F7FE'
  },
  flexWholeName: {
    borderWidth: 1,
		borderColor: '#fff',
		borderRadius: 15 * scale,
		paddingHorizontal: 16,
		paddingVertical: 6
  },
  flexWholeTitle: {
    fontSize: 11,
		color: '#fff'
  },
  itemDayTime: {
    justifyContent: 'flex-end',
    flex: 1,
    flexDirection: 'row'
  },
  consent: {
    paddingRight: 20 * scale,
    paddingLeft: 20 * scale,
    paddingTop: 8 * scale,
    paddingBottom: 8 * scale,
    fontSize: 12 * scale,
    opacity: 1,
    color: '#ffffff',
    alignItems: 'center',
    borderWidth: 1 * scale,
    borderStyle: 'solid',
    borderColor: style.color.themeColor,
    borderRadius: 15 * scale,
    // marginRight: 0 * scale,
    flexDirection: 'row',
    backgroundColor: style.color.themeColor,
    overflow: 'hidden'
  },
  itemdown: {
    fontSize: 12 * scale,
    color: style.color.themeColor,
    alignItems: 'center',
    paddingRight: 20 * scale,
    paddingLeft: 20 * scale,
    paddingTop: 8 * scale,
    paddingBottom: 8 * scale,
    borderWidth: 1 * scale,
    borderStyle: 'solid',
    borderColor: style.color.themeColor,
    borderRadius: 15 * scale,
    marginRight: 20 * scale,
    flexDirection: 'row',
    marginLeft: 10 * scale,
  },
  echarts: {
    width: 375 * scale,
    // height: 400 * scale,
    // flex: 1,
    position: 'relative'
  },
  wenText: {
    // flexDirection: 'row',
    fontSize: 12 * scale,
    color: '#000',
    position: 'absolute',
    left: 162 * scale,
    top: 90 * scale,
    zIndex: 999,
    width: 56 * scale,
  },
  flexMoney: {
    flexDirection: 'row',
    justifyContent: 'flex-end',
    paddingRight: 28 * scale,
  },
  flexMoneyName: {
    color: '#2A3E51',
    fontSize: 12 * scale,
  },
  flexProduce: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    paddingRight: 30 * scale,
    paddingLeft: 30 * scale,
    paddingTop: 16 * scale,
  },
  flexProduceBg: {
    flexDirection: 'row',
    width: 18,
    height: 10 * scale,
    marginTop: 2 * scale,
    justifyContent: 'flex-start',
    // backgroundColor: '#FF777A',
    borderRadius: 5 * scale,
    borderWidth: 1 * scale,
    borderStyle: 'solid',
    // borderColor: '#FF777A',
    overflow: 'hidden',
  },
  flexProduceName: {
    flexDirection: 'row',
    justifyContent: 'flex-start',
    width: 210 * scale,
    fontSize: 12 * scale,
    color: '#031B31',
    marginLeft: 5 * scale,
    opacity: 0.7,
  },
  flexProduceMoney: {
    flexDirection: 'row',
    justifyContent: 'flex-end',
    fontSize: 12 * scale,
    color: '#2A3E51',
  },
  flexNum: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'space-between',
    paddingTop: 12 * scale,
    paddingRight: 30 * scale,
    paddingLeft: 30 * scale,
  },
  flexNumName: {
    color: '#031B31',
    fontSize: 12 * scale,
    opacity: 0.8,
    paddingLeft: 46 * scale,
  },
  flexNumVaule: {
    color: '#2A3E51',
    fontSize: 12 * scale,
  },
  more: {
    paddingHorizontal: 10 * scale,
    paddingVertical: 10 * scale,
    color: style.color.themeColor,
    flex: 1,
    textAlign: 'center'
  },
  dataItem:{
    flexDirection:'row',
    alignItems:'center',
    marginBottom:15*scale
  },
  dataItemH:{
    marginBottom:15*scale
  },
  dataItemTitle:{
    fontSize: 12* scale,
    color: '#000000',
    opacity: 0.72,
    width:65* scale,
    marginRight:55* scale
  },
  dataItemText:{
    fontSize: 12* scale,
    color: '#000000',
    flex:1
  },
  dataBottomTitle:{
    fontSize: 14* scale,
    color: '#000000',
    marginTop:27*scale,
    marginBottom:10*scale,
  },
  fileItem:{
    flexDirection:'row',
    alignItems:'center',
    marginBottom:10*scale,
    flexWrap:"wrap"
  },
  fileText:{
    fontSize: 12* scale,
    color:'#0091FF',
    marginBottom:10*scale,
  },
  dataShopItem:{
    backgroundColor: '#F4F7FE',
    borderRadius:5*scale,
    paddingVertical:9*scale,
    paddingHorizontal:18*scale,
    marginBottom:14*scale
  },
  dataShopTitle:{
    fontSize: 12* scale,
    color:'#090909',
    fontWeight:'600'
  },
  dataShopContent:{
    flexDirection:'row',
    // alignItems:'center',
    marginTop:14*scale
  },
  dataShopHorizontal:{
    flex:1
  },
  dataShopText:{
    fontSize: 12* scale,
    color:'#090909',
    marginBottom:5*scale,
    lineHeight:18*scale
  },
  dataShopDetail:{
    fontSize: 12* scale,
    color:'#090909',
    marginBottom:8*scale,
    marginLeft:10*scale
  },
  headBox: {
		paddingTop: 50 * scale,
		backgroundColor: style.color.themeColor,
		paddingBottom: 20 * scale,
	},
	topTitle: {
		fontSize: 18 * scale,
    color: '#fff',
    fontWeight:'600'
	},
	topBox: {
		flexDirection: 'row',
		alignItems: 'center',
		justifyContent: 'space-between',
		paddingHorizontal: 18
	},
})